package com.foreknow.demo3;

/**
 * 数组的初始化
 */
public class ArrayDemo3 {
    public static void main(String[] args) {
        int[] array = new int[]{1,2,3,4,5,6,7,8};
        String[] array1 = {"AAA","BBB","CCC","DDD"};
        System.out.println(array1[2]);
        System.out.println("---------------------------------");
        for (int i = 0;i<array1.length;i++){
            System.out.println(array1[i]);
        }
        System.out.println("--------------foreach--------------------");
        for (String str:array1) {
            System.out.println(str);
        }
    }
}
